package com.zd.controller;


import com.zd.config.PageResult;
import com.zd.config.Result;
import com.zd.service.IAdminService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author TSP
 * @since 2021-08-22
 */
@RestController
@RequestMapping("/admin")
public class AdminController {

    @Autowired
    private IAdminService adminService;


    @ApiOperation(value = "获取所有管理员")
    @GetMapping("/infos")
    public Result getAllAdminByPage(@RequestParam(defaultValue = "1") Integer currentPage,
                                    @RequestParam(defaultValue = "10") Integer size) {
        PageResult pageResult = null;
        pageResult = adminService.getAllAdminByPage(currentPage, size);
        return Result.success("成功", pageResult);
    }
}
